[CPU][ARM] Constrain MHA single-token dot_product templates#34616
Open
alvoron wants to merge 5 commits intoopenvinotoolkit:masterfrom
Open
[CPU][ARM] Constrain MHA single-token dot_product templates#34616alvoron wants to merge 5 commits intoopenvinotoolkit:masterfrom
alvoron wants to merge 5 commits intoopenvinotoolkit:masterfrom
Conversation
Contributor
|
This function is extracted into common part in #34447. |
maxnick
requested changes
Mar 11, 2026
Comment on lines
+671
to
+679
| #if defined(OPENVINO_ARCH_ARM64) | ||
| template <typename TA, | ||
| typename TB, | ||
| typename std::enable_if<(std::is_same_v<TA, float> || std::is_same_v<TA, ov::float16>) && | ||
| (std::is_same_v<TB, float> || std::is_same_v<TB, ov::float16>), | ||
| bool>::type = true> | ||
| #else | ||
| template <typename TA, typename TB> | ||
| #endif |
Contributor
There was a problem hiding this comment.
Such a construct looks cumbersome and difficult to read.
Better use static_accert under corresponding macro.
Comment on lines
+1329
to
+1334
| #if defined(OPENVINO_ARCH_ARM64) | ||
| template <typename TA, | ||
| typename std::enable_if<std::is_same_v<TA, float> || std::is_same_v<TA, ov::float16>, bool>::type = true> | ||
| #else | ||
| template <typename TA> | ||
| #endif |
Contributor
There was a problem hiding this comment.
Such a construct looks cumbersome and difficult to read.
Better use static_accert under corresponding macro.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details:
dot_product(TA*, TB*, ...)to only participate for float/float16 template types via SFINAEdot_product(TA*, uint8_t*, ...)to only participate for TA in {float, float16} via SFINAEfloat x floatand used the NEON path as fallback for other supported ARM64 combinationsmha_single_tokenwith!defined(OPENVINO_ARCH_ARM64)to avoid ARM64 bf16 instantiation pathsTickets: